package net.mikoo.seals.common.enums;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

public enum SealStatusEnum {

	ENABLE("ENABLE", "启用"),

	DISABLE("DISABLE", "禁用");

	private final String code;

	private final String message;

	private SealStatusEnum(String code, String message) {
		this.code = code;
		this.message = message;
	}

	public String getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}
	
	public String code() {
		return code;
	}

	public String message() {
		return message;
	}

	public static SealStatusEnum getByCode(String code) {
		for (SealStatusEnum _enum : values()) {
			if (StringUtils.equals(_enum.getCode(), code)) {
				return _enum;
			}
		}
		return null;
	}

	public List<SealStatusEnum> getAllEnum() {
		List<SealStatusEnum> list = new ArrayList<SealStatusEnum>();
		for (SealStatusEnum _enum : values()) {
			list.add(_enum);
		}
		return list;
	}

	public List<String> getAllEnumCode() {
		List<String> list = new ArrayList<String>();
		for (SealStatusEnum _enum : values()) {
			list.add(_enum.code());
		}
		return list;
	}
}
